<?php use_stylesheets_for_form($form) ?>
<?php use_javascripts_for_form($form) ?>

<form action="<?php echo url_for('invoice/'.($form->getObject()->isNew() ? 'create' : 'update').(!$form->getObject()->isNew() ? '?invoice_id='.$form->getObject()->getInvoiceId() : '')) ?>" method="post" <?php $form->isMultipart() and print 'enctype="multipart/form-data" ' ?>>
<?php if (!$form->getObject()->isNew()): ?>
<input type="hidden" name="sf_method" value="put" />
<?php endif; ?>
  <table>
    <tfoot>
      <tr>
        <td colspan="2">
          <?php echo $form->renderHiddenFields(false) ?>
          &nbsp;<a href="<?php echo url_for('invoice/index') ?>">Back to list</a>
          <?php if (!$form->getObject()->isNew()): ?>
            &nbsp;<?php echo link_to('Delete', 'invoice/delete?invoice_id='.$form->getObject()->getInvoiceId(), array('method' => 'delete', 'confirm' => 'Are you sure?')) ?>
          <?php endif; ?>
          <input type="submit" value="Save" />
        </td>
      </tr>
    </tfoot>
    <tbody>
      <?php echo $form->renderGlobalErrors() ?>
      <tr>
        <th><?php echo $form['invoice_group']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_group']->renderError() ?>
          <?php echo $form['invoice_group'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_groupdate']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_groupdate']->renderError() ?>
          <?php echo $form['invoice_groupdate'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_datestart']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_datestart']->renderError() ?>
          <?php echo $form['invoice_datestart'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_dateend']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_dateend']->renderError() ?>
          <?php echo $form['invoice_dateend'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_servicestart']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_servicestart']->renderError() ?>
          <?php echo $form['invoice_servicestart'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_serviceend']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_serviceend']->renderError() ?>
          <?php echo $form['invoice_serviceend'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_benchmark']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_benchmark']->renderError() ?>
          <?php echo $form['invoice_benchmark'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_newprice']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_newprice']->renderError() ?>
          <?php echo $form['invoice_newprice'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_hauler_cost']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_hauler_cost']->renderError() ?>
          <?php echo $form['invoice_hauler_cost'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_comments']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_comments']->renderError() ?>
          <?php echo $form['invoice_comments'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_deleted']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_deleted']->renderError() ?>
          <?php echo $form['invoice_deleted'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_paid']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_paid']->renderError() ?>
          <?php echo $form['invoice_paid'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_hauler_paid']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_hauler_paid']->renderError() ?>
          <?php echo $form['invoice_hauler_paid'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_sent']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_sent']->renderError() ?>
          <?php echo $form['invoice_sent'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_send_date']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_send_date']->renderError() ?>
          <?php echo $form['invoice_send_date'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_last_send']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_last_send']->renderError() ?>
          <?php echo $form['invoice_last_send'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['invoice_paid_date']->renderLabel() ?></th>
        <td>
          <?php echo $form['invoice_paid_date']->renderError() ?>
          <?php echo $form['invoice_paid_date'] ?>
        </td>
      </tr>
      <tr>
        <th><?php echo $form['account_id']->renderLabel() ?></th>
        <td>
          <?php echo $form['account_id']->renderError() ?>
          <?php echo $form['account_id'] ?>
        </td>
      </tr>
    </tbody>
  </table>
</form>
